<?php
namespace UserApi\Controller;
use Zend\Mvc\Controller\AbstractRestfulController;
use Zend\View\Model\JsonModel;
class StateApiController extends AbstractRestfulController
{
    public function getList()
    {
		//echo "hi";exit;
    }
    public function get($id)
    {
	    
    }
    public function create($statedata)
    {
	    header('Access-Control-Allow-Origin: *');	
		$stateTable=$this->getServiceLocator()->get('Models\Model\StateFactory');
		$getstatelist = $stateTable->selectstatelist($statedata)->toarray();
		if(count($getstatelist)!=0){
			return new JsonModel(array(
				'data' => json_encode($getstatelist),
				'value' => 1,
			));
		}else{
			return new JsonModel(array(
				'value' => 0,
			));
		}
    }
    public function update($id, $data)
    {
        
    }
    public function delete($id)
    {
       
    }
}